<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
	<title></title>
</head>
<body>
<form>
<input type="text" name="user" id="user">
<input type="submit" value="提交">
</form>
<script type="text/javascript">
var user = document.getElementById('user');
user.onsubmit = function () {
	// this.style.backgroundColor = 'green';
	alert('asdsa');
}



</script>
</body>
</html>